<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>EasyIO-GPRS-Framework: rtservice.h源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 制作者 Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="modules.html"><span>模块</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="搜索" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>文件成员</span></a></li>
    </ul>
  </div>
<h1>rtservice.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * File      : rtservice.h</span>
<a name="l00003"></a>00003 <span class="comment"> * This file is part of RT-Thread RTOS</span>
<a name="l00004"></a>00004 <span class="comment"> * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * The license and distribution terms for this file may be</span>
<a name="l00007"></a>00007 <span class="comment"> * found in the file LICENSE in this distribution or at</span>
<a name="l00008"></a>00008 <span class="comment"> * http://www.rt-thread.org/license/LICENSE</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * Change Logs:</span>
<a name="l00011"></a>00011 <span class="comment"> * Date           Author       Notes</span>
<a name="l00012"></a>00012 <span class="comment"> * 2006-03-16     Bernard      the first version</span>
<a name="l00013"></a>00013 <span class="comment"> * 2006-09-07     Bernard      move the kservice APIs to rtthread.h</span>
<a name="l00014"></a>00014 <span class="comment"> * 2007-06-27     Bernard      fix the rt_list_remove bug</span>
<a name="l00015"></a>00015 <span class="comment"> * 2012-03-22     Bernard      rename kservice.h to rtservice.h</span>
<a name="l00016"></a>00016 <span class="comment"> */</span>
<a name="l00017"></a>00017 
<a name="l00018"></a>00018 <span class="preprocessor">#ifndef __RT_SERVICE_H__</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define __RT_SERVICE_H__</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a>00021 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00023"></a>00023 <span class="preprocessor">#endif</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00030"></a>00030 
<a name="l00034"></a><a class="code" href="group__KernelService.html#ga4cc6d94199b8cd5c2b90dc398a44f654">00034</a> <span class="preprocessor">#define RT_LIST_OBJECT_INIT(object) { &amp;(object), &amp;(object) }</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span>
<a name="l00041"></a><a class="code" href="group__KernelService.html#ga7103f52aa8c7402c9e87f03942d8bc9f">00041</a> rt_inline <span class="keywordtype">void</span> <a class="code" href="group__KernelService.html#ga7103f52aa8c7402c9e87f03942d8bc9f" title="initialize a list">rt_list_init</a>(<a class="code" href="structrt__list__node.html">rt_list_t</a> *l)
<a name="l00042"></a>00042 {
<a name="l00043"></a>00043     l-&gt;<a class="code" href="structrt__list__node.html#a50efb4b80ce8a9b46fb3a0e367d60817">next</a> = l-&gt;<a class="code" href="structrt__list__node.html#ab86c797b257b99746ccad6a733c06d38">prev</a> = l;
<a name="l00044"></a>00044 }
<a name="l00045"></a>00045 
<a name="l00052"></a><a class="code" href="group__KernelService.html#ga7d57c901bb0ee4e1b9ed92a5a196cc39">00052</a> rt_inline <span class="keywordtype">void</span> <a class="code" href="group__KernelService.html#ga7d57c901bb0ee4e1b9ed92a5a196cc39" title="insert a node after a list">rt_list_insert_after</a>(<a class="code" href="structrt__list__node.html">rt_list_t</a> *l, <a class="code" href="structrt__list__node.html">rt_list_t</a> *n)
<a name="l00053"></a>00053 {
<a name="l00054"></a>00054     l-&gt;<a class="code" href="structrt__list__node.html#a50efb4b80ce8a9b46fb3a0e367d60817">next</a>-&gt;<a class="code" href="structrt__list__node.html#ab86c797b257b99746ccad6a733c06d38">prev</a> = n;
<a name="l00055"></a>00055     n-&gt;<a class="code" href="structrt__list__node.html#a50efb4b80ce8a9b46fb3a0e367d60817">next</a> = l-&gt;<a class="code" href="structrt__list__node.html#a50efb4b80ce8a9b46fb3a0e367d60817">next</a>;
<a name="l00056"></a>00056 
<a name="l00057"></a>00057     l-&gt;<a class="code" href="structrt__list__node.html#a50efb4b80ce8a9b46fb3a0e367d60817">next</a> = n;
<a name="l00058"></a>00058     n-&gt;<a class="code" href="structrt__list__node.html#ab86c797b257b99746ccad6a733c06d38">prev</a> = l;
<a name="l00059"></a>00059 }
<a name="l00060"></a>00060 
<a name="l00067"></a><a class="code" href="group__KernelService.html#ga31047c521c265353f8372043fb6ff5ef">00067</a> rt_inline <span class="keywordtype">void</span> <a class="code" href="group__KernelService.html#ga31047c521c265353f8372043fb6ff5ef" title="insert a node before a list">rt_list_insert_before</a>(<a class="code" href="structrt__list__node.html">rt_list_t</a> *l, <a class="code" href="structrt__list__node.html">rt_list_t</a> *n)
<a name="l00068"></a>00068 {
<a name="l00069"></a>00069     l-&gt;<a class="code" href="structrt__list__node.html#ab86c797b257b99746ccad6a733c06d38">prev</a>-&gt;<a class="code" href="structrt__list__node.html#a50efb4b80ce8a9b46fb3a0e367d60817">next</a> = n;
<a name="l00070"></a>00070     n-&gt;<a class="code" href="structrt__list__node.html#ab86c797b257b99746ccad6a733c06d38">prev</a> = l-&gt;<a class="code" href="structrt__list__node.html#ab86c797b257b99746ccad6a733c06d38">prev</a>;
<a name="l00071"></a>00071 
<a name="l00072"></a>00072     l-&gt;<a class="code" href="structrt__list__node.html#ab86c797b257b99746ccad6a733c06d38">prev</a> = n;
<a name="l00073"></a>00073     n-&gt;<a class="code" href="structrt__list__node.html#a50efb4b80ce8a9b46fb3a0e367d60817">next</a> = l;
<a name="l00074"></a>00074 }
<a name="l00075"></a>00075 
<a name="l00080"></a><a class="code" href="group__KernelService.html#ga0525e5898dd57464613551b887256c28">00080</a> rt_inline <span class="keywordtype">void</span> <a class="code" href="group__KernelService.html#ga0525e5898dd57464613551b887256c28" title="remove node from list.">rt_list_remove</a>(<a class="code" href="structrt__list__node.html">rt_list_t</a> *n)
<a name="l00081"></a>00081 {
<a name="l00082"></a>00082     n-&gt;<a class="code" href="structrt__list__node.html#a50efb4b80ce8a9b46fb3a0e367d60817">next</a>-&gt;<a class="code" href="structrt__list__node.html#ab86c797b257b99746ccad6a733c06d38">prev</a> = n-&gt;<a class="code" href="structrt__list__node.html#ab86c797b257b99746ccad6a733c06d38">prev</a>;
<a name="l00083"></a>00083     n-&gt;<a class="code" href="structrt__list__node.html#ab86c797b257b99746ccad6a733c06d38">prev</a>-&gt;<a class="code" href="structrt__list__node.html#a50efb4b80ce8a9b46fb3a0e367d60817">next</a> = n-&gt;<a class="code" href="structrt__list__node.html#a50efb4b80ce8a9b46fb3a0e367d60817">next</a>;
<a name="l00084"></a>00084 
<a name="l00085"></a>00085     n-&gt;<a class="code" href="structrt__list__node.html#a50efb4b80ce8a9b46fb3a0e367d60817">next</a> = n-&gt;<a class="code" href="structrt__list__node.html#ab86c797b257b99746ccad6a733c06d38">prev</a> = n;
<a name="l00086"></a>00086 }
<a name="l00087"></a>00087 
<a name="l00092"></a><a class="code" href="group__KernelService.html#ga2b25b69a89568b7f2bf6ed5e9e70da74">00092</a> rt_inline <span class="keywordtype">int</span> <a class="code" href="group__KernelService.html#ga2b25b69a89568b7f2bf6ed5e9e70da74" title="tests whether a list is empty">rt_list_isempty</a>(<span class="keyword">const</span> <a class="code" href="structrt__list__node.html">rt_list_t</a> *l)
<a name="l00093"></a>00093 {
<a name="l00094"></a>00094     <span class="keywordflow">return</span> l-&gt;<a class="code" href="structrt__list__node.html#a50efb4b80ce8a9b46fb3a0e367d60817">next</a> == l;
<a name="l00095"></a>00095 }
<a name="l00096"></a>00096 
<a name="l00103"></a><a class="code" href="group__KernelService.html#ga52568d5666fbf7f7f5d0b96149d5ebd1">00103</a> <span class="preprocessor">#define rt_list_entry(node, type, member) \</span>
<a name="l00104"></a>00104 <span class="preprocessor">    ((type *)((char *)(node) - (unsigned long)(&amp;((type *)0)-&gt;member)))</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span>
<a name="l00108"></a>00108 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00109"></a>00109 <span class="preprocessor"></span>}
<a name="l00110"></a>00110 <span class="preprocessor">#endif</span>
<a name="l00111"></a>00111 <span class="preprocessor"></span>
<a name="l00112"></a>00112 <span class="preprocessor">#endif</span>
</pre></div></div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>类</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>文件</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>枚举</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>枚举值</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>宏定义</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address style="text-align: right;"><small>Generated at Mon Feb 10 20:46:09 2014 for EasyIO-GPRS-Framework by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
